package com.stu.design_patterns.factory._01_simple_factory;

public class CarFactory {
  private CarFactory() {}
  public static Car getInstance(String name) {
    switch(name) {
      case "Audi": return new Audi();
      case "Benz": return new Benz();
      default: throw new RuntimeException("没有这个车");
    }
  }
}
